A device-to-device (D2D) communication mode includes two modes that are respectively a D2D communication mode 1 and a D2D communication mode 2.
A centralized resource allocation scheme is used in the D2D communication mode 1. That is, when a terminal needs to send D2D data, the terminal needs to request a time-frequency resource from a network device. A distributed resource allocation scheme is used in the D2D communication mode 2. That is, when a terminal needs to send D2D data, the terminal needs to autonomously select a time-frequency resource from a preconfigured transmission resource pool.
For a terminal, when the terminal is in network coverage, a network device configures a specific mode that is in the D2D communication mode 1 and the D2D communication mode 2 and that is used by the terminal. In addition, at a specific moment, the network device can configure only one of the D2D communication mode 1 or the D2D communication mode 2 for the terminal. When the network device configures the D2D communication mode 1 for the terminal, all logical channels in the terminal use the D2D communication mode 1. In this case, the terminal needs to consume a large quantity of signaling resources of the network device. When the network device configures the D2D communication mode 2 for the terminal, all logical channels in the terminal use the D2D communication mode 2. In this case, it is difficult for the terminal to satisfy quality of service (QoS) requirements of some services. That is, a resource allocation mode used during D2D communication is relatively single and is not flexible enough.